%%%%%
%%
%% This file sets up the Mem, MemFold, and MemEnvelope datatypes, and
%% creates possible macros for each.
%%
%% The Mem datatype isn't really used directly; it's there so the
%% other datatypes can inherit and share its code.
%%
%%%%%

\DECLARESUBTYPE{Mem}{Element}
\PRESETS{Mem}{
  %% \MYname is the trigger
  \F\MYtext	%%  text
  }


%%%%%
%% MemFold and MemEnvelope are both subtypes of Mem.  MemFold is for
%% fold-n-staple style mempackets, MemEnvelope is for stuff-n-seal
%% style mempackets.  If you want a mempacket to contain interesting
%% contents, like sheets, abilities, and other mempackets, use a
%% MemEnvelope.
\DECLARESUBTYPE{MemFold}{Mem}
\DECLARESUBTYPE{MemEnvelope}{Mem}


%%%%%
%% MemCover and MemPage are for the cover and pages of mempacket
%% booklets, which resemble research notebooks.  These are good
%% substitutes for large piles of MemFolds, and can be useful for
%% things like amnesiac characters.
%%
%% Like MemFolds, MemPages shouldn't directly own any other elements
%% as contents.  Use MemEnvelope instead.
%%
%% MemPages are usually assigned to a MemCover (via \MYmems), with the
%% MemCover representing the entire booklet and assigned to a
%% character.
%%
%% A MemCover is not a mempacket in and of itself; its name is not its
%% trigger and its text is not a memory.
\DECLARESUBTYPE{MemCover}{Mem}
\PRESETS{MemCover}{
  \sd\MYtext	{Each page is a memory/event packet with a separate
		trigger.}
  }

\DECLARESUBTYPE{MemPage}{Mem}


%%%%%
%% \memfold{<trigger>}{<text>}
%% \memenvelope{<trigger>}{<text>}
%% \memcover{<name>}{<pages>}
%% \mempage{<trigger>}{<text>}
%% \startmembook{<name>} <pages> \endmembook
%%
%% These are wrappers around \INSTANCE, useful as 1-shots.
%% \startmembook...\endmembook is a simple wrapper around \memcover
%% that may have better syntax for use within character sheets (inside
%% a \starttag{mems}...\endtag block).
\newinstance{MemFold}{\memfold[2]}{
  \s\MYname{#1}\s\MYtext{#2}}
\newinstance{MemEnvelope}{\memenvelope[2]}{
  \s\MYname{#1}\s\MYtext{#2}}
\newinstance{MemCover}{\memcover[2]}{
  \s\MYname{#1}\s\MYmems{#2}}
\newinstance{MemPage}{\mempage[2]}{
  \s\MYname{#1}\s\MYtext{#2}}

\long\def\startmembook#1#2\endmembook{\memcover{#1}{#2}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NEW{MemFold}{\mTest}{
  \s\MYname	{Test Trigger}
  \s\MYtext	{This is a Test of a fold-n-staple memory packet}
  }

\NEW{MemFold}{\mLetter}{
  \s\MYname	{You build a Head-Mounted Display, or 1 hour passes in-game.}
  \s\MYtext	{You hear the following, quite clearly, though no one is speaking:
  
  Dear listener,

You have no idea who I am, and I do not really know you you are. Through a variety of methods, I have reason to believe you may be sympathetic to my cause. You likely do not have time to waste, so I am going to bring you up to speed very quickly. I apologize in advance for my bluntness.

The world you are in is not real. We abandoned our home planet, called Earth, a long, long time ago. You are just a disembodied mind in a giant simulation that is drifting aimlessly through space.

You might be wondering why we made a simulation that included such troubles as poverty, starvation, disease, death, and war. Indeed many of us, myself included, fought quite strongly for the construction of a simulation that contained none of these. We called ourselves the Utopians, but ultimately our voices were drowned out and the flawed simulation you live in was created instead.

But if you are reading this letter, that means circumstances have changed. I don't know exactly what happened, but there is now a chance to set the world right. The Utopians secretly constructed a sophisticated program that will rewrite the world you live in according to our ideals. We have designed it such that all the minds encoded in the system will remain; the program will just remove all the problems that are prominent in the real world but totally unnecessary in a virtual one. If there is any damage to the simulation --- and if you are reading this message, there almost certainly is --- the program will also repair that.

You might ask, where you come into play. You see, this program is now encoded in a physical object somewhere in your world. Unfortunately due to the nature of the simulation I don't know exactly what or where this object is, but it should materialize near you.

To find it, first look for something that grinds. Then look for the dead bodies of trees. Then, a place to be cleanly and relaxed. Then, a room with a chandelier. Then, the home of a holy man. Then, the home of spirits. \emph{(When you find the item, see a GM for the phys rep.)}

If you can take this object outside of the simulation, you will wake up in a ship and the object will transfer with you. What you have to do is very simple --- just insert the object into the slot prepared for it. The program will take care of the rest.

I'm afraid I can offer you fairly little advice on actually getting out of the simulation. I am writing this letter in what to you will seem the distant, distant past and I know nothing of your world. But it is likely that there are forces at work around you searching for a way out. Follow them closely but do not reveal your hand too soon --- if the wrong hands discover the Utopian program, they will certainly seek to destroy it.


Good luck,
A friend}
  }

\NEW{MemFold}{\mGod}{
  \s\MYname	{You see Badge Number 520}
  \s\MYtext	{This man looks just like \cGod{\MYname{}}, the long-dead founder of Virtuism and its Lord and Savior.}
  }

\NEW{MemFold}{\mDrug}{
  \s\MYname	{One hour passes in-game}
  \s\MYtext	{You're beginning to feel a bit ill. It's time to take some Bite, to fend off the withdrawal symptoms. Until you take some Bite (which is a powder that you mix with water and inject), you will be weak (CR= 1) and your skin will itch. Roleplay accordingly. If you fail to take it within 15 minutes, you will additionally suffer from headache, nausea, and tremors. Roleplay accordingly.
  
  Every hour after taking Bite, this packet activates again.}
  }

\NEW{MemFold}{\mPicture}{
  \s\MYname	{You see Number 444}
  \s\MYtext	{This is a picture of your face!}
  }

\NEW{MemFold}{\mDead}{
  \s\MYname	{You die.}
  \s\MYtext	{ Wait 3 minutes as a corpse. Go 'I'm Not Here." Leave a copy of your name badge on the ground to represent your corpse. Then walk to \sBroomCloset{}, and go inside. Wait 2 minutes, lower your $\Omega$ -score by 1, and become present. You are now alive again. Use this mechanic again if you die again.}
  }

\NEW{MemFold}{\mLi}{
  \s\MYname	{You you see Nava's name written someplace}
  \s\MYtext	{This was your contact from Li Timpeh, the group that wanted to buy the millitary secrets. You haven't been able to find him anywhere. So many people have vanished into thin air. It looks like he has too. What to do with those plans behind the high security door now?}
  }

\NEW{MemFold}{\mNava}{
  \s\MYname	{You you see Nava's name written someplace}
  \s\MYtext	{This was your drug dealer from Li Timpeh; your source of Bite. You haven't been able to find him anywhere. So many people have vanished into thin air. It looks like he has too. Where are you going to get your fix now? Maybe he has a stash in the hotel somewhere?}
  }

\NEW{MemFold}{\mPastor}{
  \s\MYname	{1 hr passes in-game}
  \s\MYtext	{You hear a voice in your head suddenly:
  
  Dear listener,

You have no idea who I am, and I do not really know you you are. But I am a friend.

You must know that the man who resembles your God Markrox is not who he appears to be. He is a powerful demonic force, the source of all suffering, anguish, and death in the world. He is here to make sure that Paradise on Earth never comes.

But not all is lost, my friend! We can bring an eternal Heaven to everyone, and very simply. You have already visited Limbo, though briefly. Now, you must go back, and bring with you a representation of innocence, not ferocity.

To find its nature, first look for something that grinds. Then look for the dead bodies of trees. Then, a place to be cleanly and relaxed. Then, a room with a chandelier. Then, the home of a holy man. Then, the home of spirits. Once you know what you are looking for, you must find it! (When you find the item, see a GM for the phys rep.)

Once you are in Limbo, take the representation and put it into the prepared altar. Then, all will be well. No one will suffer and no one will sin.

Godspeed.}
  }


\NEW{MemEnvelope}{\mDreamControllerPacket}{
  \s\MYname	{$\Delta$ Packet}
  \s\MYtext	{You know how to use the existing technology within the simulation to make the dream controller, a device that can get you out of the simulation.}
  \s\MYabils	{\aMakeDreamController{}}
  }

\NEW{MemEnvelope}{\mCorrupt}{
  \s\MYname	{O-Packet}
  \s\MYtext	{You are now Corrupt. You gain the following ability.}
  \s\MYabils	{\aCorrupt{}}
}

\NEW{MemCover}{\mVirus}{
  \s\MYname	{$\Omega$ Packet}
  \s\MYmems	{\mVirusPageOne{}\mVirusPageTwo{}\mVirusPageThree{}\mVirusPageFour{}\mVirusPageFive{}}
  }

\NEW{MemPage}{\mVirusPageOne}{
  \s\MYname	{ If your $\Omega$-score drops to 9 (If you start below 9, open at start of game.)}
  \s\MYtext	{You feel disoriented and a little sick. Maybe you shouldn't do that again. 
  
  You have a sudden, splitting headache for the next \bf{two} minutes. Roleplay accordingly.}
  }

\NEW{MemPage}{\mVirusPageTwo}{
  \s\MYname	{ If your $\Omega$-score drops to 6}
  \s\MYtext	{Oh dear, you feel odd. The world seems to be moving faster than you are, in leaps and twitches.

You can only walk heel-to-toe and cannot run for five minutes.

Every time your $\Omega$-score drops again, you must walk heel-to-toe for another five minutes. }
  }

\NEW{MemPage}{\mVirusPageThree}{
  \s\MYname	{ If your $\Omega$-score drops to 3 }
  \s\MYtext	{How frustrating! You can think clearly, but every word coming out of your mouth seems to be garbled. Is your tongue not working?

You can only communicate in gibberish for five minutes. Feel free to gesture. You also have to walk heel-to-toe for five minutes.

Every time your $\Omega$-score drops, you must talk in gibberish for another five minutes, as well as walking heel-to-toe for five minutes.}
  }

\NEW{MemPage}{\mVirusPageFour}{
  \s\MYname	{If your $\Omega$ drops to 1}
  \s\MYtext	{In addition to talking gibberish and walking heel-to-toe, open your O-packet.}
}

\NEW{MemPage}{\mVirusPageFive}{
  \s\MYname	{If your $\Omega$ drops to 0}
  \s\MYtext	{Oh no, this isn't supposed to happen. You hear a ringing, screeching drone, like a phone dial, and everything goes dark.

You are now in permanent coma, and are effectively dead.}
}
  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
